<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
*/

/**
 * Description of LoginManager
 *
 * @author keoni
 *
 */
class SessionManager {

    static function iniciarSesion($username,$tipo) {
        $_SESSION["username"] = $username;
        $_SESSION["login"] = true;
        $_SESSION["tipo"] = $tipo;
    }

    static function haySesion() {
        if ($_SESSION["login"] != true || !isset ($_SESSION["login"])) {
            $_SESSION["username"] = "";
            $_SESSION["login"] = false;
            $_SESSION["tipo"] = "";
            return false;
        }
        else
            return true;
    }

    static function cerrarSesion() {
        $_SESSION["login"] = false;
        $_SESSION["username"] = "";
        $_SESSION["tipo"] = "";
        session_destroy();
    }
}
?>
